/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.transformation.editor.views.figures;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.graphics.Color;

import edu.pku.notation.runtime.draw2d.CircleFigure;
import edu.pku.sei.modeler.figures.CommonFigure;

/**
 * @generated
 * 
 */
public class InitialNodeFigure extends CommonFigure {
	public static final org.eclipse.swt.graphics.Color INITIALNODE_COLOR = new Color(
			null, 175, 178, 239);
	public IFigure root = null;

	public InitialNodeFigure() {
		super();
		XYLayout xyL = new XYLayout();
		setLayoutManager(xyL);
		setOpaque(true);

		root = new CircleFigure();
		root.setOpaque(false);
		root.setBackgroundColor(ColorConstants.buttonDarkest);
		// root.setForegroundColor(ColorConstants.buttonLightest);
		add(root);
		setToolTip(new Label("initial node"));

	}

	public void setBounds(Rectangle rect) {
		rect.setSize(20, 20);
		super.setBounds(rect);
		if (root != null)
			root.setSize(rect.width, rect.height);
	}
}
